<script>
  import config from './config'
  import store from '@/store'
  import { getToken } from '@/utils/auth'

  export default {
    onLaunch: function() {
      // this.initApp()
    },
    methods: {
      // 初始化应用
      initApp() {
        // 初始化应用配置
        this.initConfig()
        // 检查用户登录状态
        this.checkLogin()
      },
      initConfig() {
        this.globalData.config = config
      },
      checkLogin() {
		  console.log('tokentokentokentoken',uni.getStorageSync('token'))
        if (!uni.getStorageSync('token')) {
          this.$tab.reLaunch('/pages/login') 
        }else{
			this.$tab.reLaunch('/pages/index') 
		}
      }
    }
  }
</script>

<style lang="scss">
 	@import "@/uni_modules/uview-ui/index.scss";
  @import url("~@/static/font/stylesheet.css");
  @import '@/static/scss/index.scss'

</style>
